from google.appengine.ext import webapp
from google.appengine.ext.webapp.util import run_wsgi_app
from google.appengine.ext.webapp import template
from google.appengine.api import urlfetch

class MainPage(webapp.RequestHandler):
	def get(self):		
		url = "http://person-finder.appspot.com/api/search?key=auth_token&subdomain=test-nokey&q=test%20with"	
		result = urlfetch.fetch(url)
		
		if result.status_code == 200:			
			values = {'body': result.content}	
			self.response.out.write(template.render('templates/main.html', values))

application = webapp.WSGIApplication(
                                     [('/', MainPage)],
                                     debug=True)
									 
def main():
    run_wsgi_app(application)

if __name__ == "__main__":
    main()